package JsonInterface.test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class T5 {
    public static void main(String[] args) {
        String str = "aaaA";
        Pattern compile = Pattern.compile("[0-9a-zA-z]+");
        Matcher matcher = compile.matcher(str);
        boolean b = matcher.matches();
        System.out.println(b);//Output: true
        str = "Qwer2~";
        matcher = compile.matcher(str);
        b = matcher.matches();
        System.out.println(b);//Output: false
    }
}
